<template>
  <sweet-form :model="form" label-position="left" label-width="120px">
    <sweet-form-item>
      <template #label>
        <sweet-tooltip content="Activity name Display of extra-long labels" placement="bottom" effect="light">
          <span>Activity name Display of extra-long labels</span>
        </sweet-tooltip>
      </template>
      <sweet-input v-model="form.name" />
    </sweet-form-item>
    <sweet-form-item label="Activity zone">
      <sweet-select v-model="form.region" placeholder="please select your zone">
        <sweet-option label="Zone one" value="shanghai" />
        <sweet-option label="Zone two" value="beijing" />
      </sweet-select>
    </sweet-form-item>
    <sweet-form-item label="Activity time">
      <sweet-col :span="11">
        <sweet-date-picker v-model="form.date1" type="date" placeholder="Pick a date" style="width: 100%" />
      </sweet-col>
      <sweet-col :span="1" class="text-center">
        <span class="text-gray-500">-</span>
      </sweet-col>
      <sweet-col :span="6">
        <sweet-time-picker v-model="form.date2" placeholder="Pick a time" style="width: 100%" />
      </sweet-col>
    </sweet-form-item>
    <sweet-form-item label="Instant delivery">
      <sweet-switch v-model="form.delivery" />
    </sweet-form-item>
    <sweet-form-item label="Activity type">
      <sweet-checkbox-group v-model="form.type">
        <sweet-checkbox label="Online activities" name="type" />
        <sweet-checkbox label="Promotion activities" name="type" />
        <sweet-checkbox label="Offline activities" name="type" />
        <sweet-checkbox label="Simple brand exposure" name="type" />
      </sweet-checkbox-group>
    </sweet-form-item>
    <sweet-form-item label="Resources">
      <sweet-radio-group v-model="form.resource">
        <sweet-radio label="Sponsor" />
        <sweet-radio label="Venue" />
      </sweet-radio-group>
    </sweet-form-item>
    <sweet-form-item label="Activity form">
      <sweet-input v-model="form.desc" type="textarea" />
    </sweet-form-item>
    <sweet-form-item>
      <sweet-button>Cancel</sweet-button>
      <sweet-button type="primary" @click="onSubmit">Create</sweet-button>
    </sweet-form-item>
  </sweet-form>
</template>

<script setup>
import {reactive} from 'vue';

const form = reactive({
  name: '',
  region: '',
  date1: '',
  date2: '',
  delivery: false,
  type: [],
  resource: '',
  desc: ''
});

const onSubmit = () => {
  console.log('submit!');
};
</script>
